package com.xiaolin.web.common.utils;

import java.util.HashMap;

/**
 * @ClassName R
 * @Description TODO
 * @Detail detail
 * @Author MyPC
 * @Date 2020/9/29
 * @Version 1.0
 */
public class R extends HashMap<String,Object>{

    public R(){
        R r = new R();
        r.put("code",200);
        r.put("msg","成功");
    }
    public static R error(int code, String msg) {
        R r = new R();
        r.put("code", code);
        r.put("msg", msg);
        return r;
    }

    public static R success() {
        R r = new R();
        r.put("code", 200);
        r.put("msg", "success");
        return r;
    }

    public R put(String key, Object value) {
        super.put(key, value);
        return this;
    }
}
